package org.apache.catalina.startup;

import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
import org.apache.tomcat.util.ExceptionUtils;

import com.github.netty.StartupServer;
import com.github.netty.protocol.servlet.ServletContext;

public class Tomcat {
	private static final Log log = LogFactory.getLog(Tomcat.class);

	public Tomcat() {
		ExceptionUtils.preload();
	}

	public static void main(String[] args) {
		ServletContext servletContext = new ServletContext();
		servletContext.setDocBase(System.getProperty("user.dir"), "/webapp");
		
		ServletContextConfig scc = new ServletContextConfig(servletContext);
		
		StartupServer server = new StartupServer(scc.getPort());
		server.addProtocol(scc.getHttpServletProtocol());
		server.start();
	}

}
